<?php
/*
 * Created by selva 24/11/2010
 * email : selvakumar@contus.in
 * To mention the subscribe page form.
 *
 * Updated by : sathish 24/01/2011
 * Default Newsletter subscribe page.
 * */

$select = "";
$cities = array();
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', '548'); // get the cities attribute id 548
// to get the multiple cities in pages(drop down)
foreach ($attribute->getSource()->getAllOptions(true, true) as $option) {
    $value = $option['value'];
    if ($value != '') {
        $cities[$value] = $option['label'];
        $select .= "<option value='" . $option['label'] . "'>" . $option['label'] . "</option>";
    }
}
?>

<script type="text/javascript" src="<?php echo $this->getJsUrl('prototype/prototype.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getJsUrl('prototype/validation.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getJsUrl('varien/form.js') ?>"></script>

<div class="main">

    <h1 class="logo" >

        <a href="<?php echo $this->getUrl(); ?>"><img src="<?php echo $this->getSkinUrl('images/logo.png'); ?>" width="291" height="36" alt="logo" title="" /></a>

    </h1>

</div>

<div class="container">

    <div class="page_content clearfix">



        <!--- subscribtion form start --->

        <form  action="<?php echo $this->getUrl('newsletter/subscriber/new') ?>" method="post" id="newsletter-validate-detail">

            <div id="enter-mail">

                        <!--<img src="<?php echo $this->getSkinUrl('images/email-address-img.gif'); ?>" width="188" height="16" alt="Enter Email Address" title="" />-->

                <span class="infotext"><?php echo $this->__('Enter your email address'); ?></span>

                <div class="mail-box" >

                    <input name="email" type="text" size="30" id="newsletter1" class="searchinput1 validate-email required-entry" value="<?php echo $this->__('Enter your email address here...'); ?>" onfocus="if (this.value == '<?php echo $this->__('Enter your email address here...'); ?>') {this.value = '';this.style.color ='black';}" onblur="if (this.value == '') {this.style.color ='black';this.value = '<?php echo $this->__('Enter your email address here...'); ?>';}"  />

                </div>

                <div id="error_msg" style="color:red; font-family: Helvetica, sans-serif; font-size: 10px; position: absolute;"></div>

            </div>

            <div id="confirm-city">

                        <!--<img src="<?php echo $this->getSkinUrl('images/confirm-city-img.gif'); ?>" width="140" height="18" alt="Confirm your city" title="" />-->

                <span class="infotext"><?php echo $this->__('Confirm your city'); ?></span>

                <div class="clear"></div>

                <div class="confirm-city-box">

                    <select id="city" class="input-text required-entry" name="city"  style="width: 190px;margin:8px;border:none;font-size:12px;">

                        <option value=""><?php echo $this->__('Select your City'); ?></option>

                        <?php echo $select; ?>

                    </select>

                </div>

            </div>

            <div class="clear"></div>

            <div class="button_container">

                <div class="button_sub buttons">

                    <input type="hidden" name="task" id="task" value="confirmSubscribe" />

                    <button type="submit" class="button subscribe"   ></button>

                    <a class="button continue" href="<?php echo $this->getUrl() . '?task=confirmSubscribe'; ?>" id="step_one">Today's Deal</a>

                </div>

            </div>
            <div class="clear"></div>

        </form>
        <!--- subscribtion form end --->
    </div>

</div>
<script type="text/javascript">
    //<![CDATA[
    var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
    //]]>
</script>
